<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="../js/layui/css/layui.css">
    <script src="../js/layui/layui.js"></script>
</head>
<body>
    <!--<form id="productForm" method="post">-->
        <form id="productForm" class="layui-form" method="post" lay-filter="productFilter">

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">职位名称</label>
                <div class="layui-input-inline">
                    <input type="text" name="workname" autocomplete="off" class="layui-input">
                </div>
                <label class="layui-form-label">工作地点</label>
                <div class="layui-input-inline">
                    <input type="text" name="workingplace" autocomplete="off" class="layui-input">
                </div>
            </div>
        </div>

        <div class="layui-form-item">

            <div class="layui-inline">
            <label class="layui-form-label">期望工资</label>
            <div class="layui-input-inline">
                <input type="text" name="wage" autocomplete="off" class="layui-input">
            </div>
            <label class="layui-form-label">行业</label>
            <div class="layui-input-inline">
                <input type="text" name="hangye" autocomplete="off" class="layui-input">
            </div>
        </div>
        </div>
            <div class="layui-form-item">
                <label class="layui-form-label">求职时间</label>
                <div class="layui-input-block">
                    <input id="ad" type="text" name="qiuzhidate"  placeholder="" autocomplete="off" class="layui-input">
                </div>
            </div>
        <div class="layui-form-item">
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">自我评价</label>
                <div class="layui-input-block">
                    <textarea name="pingjia" placeholder="例如：两年UI设计经验，熟悉IOS和Android的界面设计规划，对产品本色有独特见解，有一定的手绘能力" class="layui-textarea"></textarea>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
                <label class="layui-form-label">工作性质</label>
                <div class="layui-input-block">
                    <input type="radio" name="worktype" value="1">全职
                    <input type="radio" name="worktype" value="2">实习
                    <input type="radio" name="worktype" value="3">兼职
                </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="formDemo" >立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</body>
<script>

    var $;
    layui.use(['form','layer','jquery','laydate'], function () {
        /*['form','layer','jquery','laydate']*/
        // 操作对象
        var form = layui.form,
            layer = layui.layer,
            layedit = layui.layedit,
            laydate = layui.laydate;
        $=layui.jquery;
        //日期
        laydate.render({
            elem: '#ad',
            type:'datetime'
        });
        form.on('submit(formDemo)',function (data) {
            /*alert(111)*/
            $.ajax({
                url:'../web/addProduct',
                data:$("#productForm").serialize(),
                type:'post',
                dataType:'json',
                success:function (data) {
                    if (data.code==0){
                        alert("成功");
                    }else{
                        layer.msg('新增成功');
                    }
                }
            })
            return false;
        })
    });

</script>
</html>